package com.zhouqinuan.spring.cloud.develop.framework.demo.fastdfs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.zhouqinuan.spring.cloud.develop.framework.fastdfs.service.FastDFSService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "fastdfs测试例子")
@RestController
@RequestMapping("/fastdfs")
public class FastdfsController {

    @Autowired
    private FastDFSService fastDFSService;

    @ApiOperation("上传文件")
    @PostMapping("/upload")
    public String upload(@RequestParam("uploadFile") MultipartFile multipartFile) throws Exception {

        return fastDFSService.upload(multipartFile);
    }
}
